<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
    <meta http-equiv="Pragma" content="no-cache" />
    <meta http-equiv="Expires" content="0" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>Document</title>
    <link href="http://apps.bdimg.com/libs/highlight.js/9.1.0/styles/monokai-sublime.min.css" rel="stylesheet">
    <script src="http://apps.bdimg.com/libs/highlight.js/9.1.0/highlight.min.js"></script>
    <style>
        html {
            overflow: hidden;
            height: 100%;
        }

        body {
            height: 100%;
            overflow: auto
        }

        code {
            font-size: 15px;
            padding: 20px !important;
        }

        img {
            max-width: 100%;
        }

        .tobog {
            display: flex;
            min-height: 100%;
            width: 100%;
        }

        /* .tobog .menu {
            width: 200px;
            flex: none;
            border-right: 1px solid #dcdcdc;
            min-height: 100%;
        } */

        .tobog .content {
            flex: auto;
            padding: 20px;
        }

        h3 {
            margin: 0;
        }

        .menu a {
            display: block;
            padding-left: 30px;
            line-height: 36px;
            font-size: 14px;
            cursor: pointer;
        }



        .tobog .title {
            font-size: 18px;
            font-weight: bold;
            padding-left: 15px;
            line-height: 40px;
        }

        .markdown-code {
            display: none;
        }

        .hljs-comment,
        .hljs-deletion,
        .hljs-meta {
            color: #a3a3a0;
        }

        .menu a.active,
        .menu a:hover {
            background-color: #2db7f5;
            color: #fff;
        }
    </style>
</head>

<body>
    <div class="tobog" id="code">
        <div class="content">
            <div id="md_render">

            </div>
        </div>
    </div>
    <script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
    <script>
        renderDoc('/pwa/README.md')
        function renderDoc(url) {
            fetch(url).then(res => {
                return res.text()
            }).then(res => {
                let html = marked(res);
                md_render.innerHTML = html;
                this.renderHtml = html
                document.querySelectorAll('pre code').forEach((block) => {
                    hljs.highlightBlock(block);
                });
            })
        }

    </script>
</body>

</html>